From: Keir Fraser Date: Tue, 7 Apr 2009 10:04:27 +0000 (+0100) Subject: xentrace: Only trace 64b vmexit when in long mode. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13988^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6cc1002a775bdf4d155aef6492bc486339096167;p=xen.git xentrace: Only trace 64b vmexit when in long mode. Signed-off-by: George Dunlap --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index bd320fbe1f..a70f0ffd95 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1217,9 +1217,14 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs) exit_reason = vmcb->exitcode; - HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason, - (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32), - 0, 0, 0); + if ( hvm_long_mode_enabled(v) ) + HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason, + (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32), + 0, 0, 0); + else + HVMTRACE_ND(VMEXIT, 1/*cycles*/, 2, exit_reason, + (uint32_t)regs->eip, + 0, 0, 0, 0); if ( unlikely(exit_reason == VMEXIT_INVALID) ) { diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 3374ebb657..2d4c44bd63 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2241,9 +2241,14 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs) exit_reason = __vmread(VM_EXIT_REASON); - HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason, - (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32), - 0, 0, 0); + if ( hvm_long_mode_enabled(v) ) + HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason, + (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32), + 0, 0, 0); + else + HVMTRACE_ND(VMEXIT, 1/*cycles*/, 2, exit_reason, + (uint32_t)regs->eip, + 0, 0, 0, 0); perfc_incra(vmexits, exit_reason);